import request from '@/utils/request'

// 充值接口v2 type wxQr(微信扫码) wxH5(微信h5) wxJsApi(wxJsApi) alipayQr(支付宝扫码) alipayH5（支付宝h5）
// code微信授权 扩展参数
export function payment(type, amount, code) {
  return request({
    url: '/ec/balancePay/payment/' + type + "/" + amount,
    header: {'code': code},
    method: 'put',
  })
}

// 订单查询接口
export function getOrderStatus(orderId) {
  return request({
    url: '/ec/balancePay/wx/check/'+orderId,
    method: 'get',
  })
}

// 查询账户余额充值明细列表
export function listBalancePay(query) {
  return request({
    url: '/ec/balancePay/list',
    method: 'get',
    params: query
  })
}

// 查询账户余额充值明细详细
export function getBalancePay(id) {
  return request({
    url: '/ec/balancePay/' + id,
    method: 'get'
  })
}

// 新增账户余额充值明细
export function addBalancePay(data) {
  return request({
    url: '/ec/balancePay',
    method: 'post',
    data: data
  })
}

// 原路退款申请
export function refundPay(data) {
  return request({
    url: '/ec/balancePay/refundPay',
    method: 'put',
    data: data
  })
}

// 删除账户余额充值明细
export function delBalancePay(id) {
  return request({
    url: '/ec/balancePay/' + id,
    method: 'delete'
  })
}
